{% if session['phone'] %}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>BaWang Center</title>

    <!-- Bootstrap Core CSS -->
    <link href="/static/sbadmin/css/bootstrap.min.css" rel="stylesheet">
    <!-- MetisMenu CSS -->
    <link href="/static/sbadmin/css/metisMenu.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="/static/sbadmin/css/sb-admin-2.css" rel="stylesheet">
    <!-- Morris Charts CSS -->
    <link href="/static/sbadmin/css/morris.css" rel="stylesheet">
    <!-- Custom Fonts -->
    <link href="/static/sbadmin/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    {% block css %} {% endblock %}
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <div id="wrapper">
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <a class="navbar-brand" href="/admin">BaWang Center</a>
            </div>
            <!-- /.navbar-header -->
            <ul class="nav navbar-top-links navbar-right">
            	<li class="dropdown">
                    <a class="dropdown-toggle"  href="/user/logout">
                        <i class="fa fa-sign-out fa-fw"></i>
                    </a>
                </li>
                <li class="dropdown">
                    <a class="dropdown-toggle"  href="/user/{{ session.username }}">
                        <i class="fa fa-user fa-fw"></i>
                    </a>
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->

            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                            <!-- /input-group -->
                        </li>
                        <li>
                            <a href="/admin"><i class="fa fa-dashboard fa-fw"></i> Dashboard</a>
                        </li>
                        <li>
                            <a href="/monitor/views"><i class="fa fa-table fa-fw"></i> 监控平台</a>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-envelope"></i> 短信平台<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="/tools/class_notify">上课通知</a>
                                    <a href="/tools/send_message">短信通知</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> 自动化平台<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="/tools/run">远程执行命令</a>
                                    <a href="/tools/mult_run">批量远程执行命令</a>
                                    <a href="/tools/mult_upload">批量上传文件</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> 二级菜单<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="panels-wells.html">子菜单</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-sitemap fa-fw"></i> 三级菜单<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="#">子菜单</a>
                                </li>
                                <li>
                                    <a href="#">二级菜单 <span class="fa arrow"></span></a>
                                    <ul class="nav nav-third-level">
                                        <li>
                                            <a href="#">子菜单</a>
                                        </li>
                                    </ul>
                                    <!-- /.nav-third-level -->
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">{% block title %} {% endblock %}</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
               {% block content %} {% endblock %}
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="/static/sbadmin/js/jquery.min.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="/static/sbadmin/js/bootstrap.min.js"></script>
    <!-- Metis Menu Plugin JavaScript -->
    <script src="/static/sbadmin/js/metisMenu.min.js"></script>
    <!-- Morris Charts JavaScript -->
    <script src="/static/sbadmin/js/raphael.min.js"></script>
    <script src="/static/sbadmin/js/morris.min.js"></script>
    <script src="/static/sbadmin/js/morris-data.js"></script>
    <!-- Custom Theme JavaScript -->
    <script src="/static/sbadmin/js/sb-admin-2.js"></script>
    {% block js %} {% endblock %}
</body>

</html>
{% else %}
    <script language="javascript" type="text/javascript"> 
        window.location.href="/user/login"; 
    </script> 
{% endif %}